
#ifndef _MEMBER_BMenu_H_
#define _MEMBER_BMenu_H_

#include <BRect>
#include <BAction>
#include <BMenu>

#define menu_member(menu)		((member_BMenu*)((BMenu*)menu)->_ptr)

namespace BWE
{
	class ActionItem
	{
	public:
		ActionItem()
		{
			action = 0;
		}
		ActionItem(BAction* action)
		{
			this->action = action;
		}
		bool operator == (const BAction* action)
		{
			return this->action == action;
		}

		BRect			rect;
		BActionHolder	action;
	};

	class member_BMenu : public BObject
	{
	public:
		member_BMenu(BMenu* menu);
		~member_BMenu();
		
		void slotTextChanged(BObject* object, const BValue& value);

		void adjustRects();

		BMenu*					boss;
		int						spacing;
		int						hoverIndex;
		bool					pressed;
		BString					t_title;
		bool					dirty;
		BArray<ActionItem>		actions;
	};
}

#endif